package Template;

import Template.interfacesImpl.CoffeeWithHook;
import Template.interfacesImpl.Duck;
import Template.interfacesImpl.Tea;
import org.junit.Test;

import java.util.Arrays;

/**
 * @Author: pengzx
 * @Description:
 * @Date: 11:31 2017/9/15
 * @Modified by: 1.0
 */
public class Demo {
    @Test
    public void test()
    {
        //Tea myTea = new Tea();
        //myTea.prepareRecipe();

        CoffeeWithHook coffeeWithHook = new CoffeeWithHook();
        coffeeWithHook.prepareRecipe();
    }

    public static void main(String[] args)
    {
        CoffeeWithHook coffeeWithHook = new CoffeeWithHook();
        coffeeWithHook.prepareRecipe();
    }

    @Test
    public void DUckSortTest()
    {
        Duck[] ducks = {new Duck("Daffy", 8), new Duck("Deway", 2), new Duck("Howard", 7),new Duck("Louie",2),new Duck("Donald",10)};
        System.out.println("之前的排序...");
        display(ducks);

        System.out.println("排序后...");
        Arrays.sort(ducks);
        display(ducks);
    }

    public void display(Duck[] ducks){
        for (int i=0,j=ducks.length;i<j;i++){
            System.out.println(ducks[i]);
        }
    }
}
